<?php

/**
 * LEAGUEMan
 * 
 * Copyright (C) 2007 Marko Bischof
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

class LM_Ranking_Row
{
    protected $team;
    protected $last;
    protected $cnt_v;
    protected $cnt_v_after_extra;
    protected $cnt_v_after_penalty;
    protected $cnt_t;
    protected $cnt_t_after_extra;
    protected $cnt_t_after_penalty;
    protected $cnt_d;
    protected $cnt_d_after_extra;
    protected $cnt_d_after_penalty;
    protected $cnt_matches;
    protected $score1;
    protected $score2;
    protected $points;
    protected $points2;

    public function __construct($team)
    {

        $this->team = $team;

        $this->last = 0;

        $this->cnt_v = 0;
        $this->cnt_v_after_extra = 0;
        $this->cnt_v_after_penalty = 0;

        $this->cnt_t = 0;
        $this->cnt_t_after_extra = 0;
        $this->cnt_t_after_penalty = 0;

        $this->cnt_d = 0;
        $this->cnt_d_after_extra = 0;
        $this->cnt_d_after_penalty = 0;

        $this->cnt_matches = 0;
        $this->score1 = 0;
        $this->score2 = 0;

        $this->points = 0;
    }

    public function getTeam()
    {
        return $this->team;
    }

    public function setLast($last)
    {
        $this->last = $last;
    }

    public function incMatches()
    {
        $this->cnt_matches++;
    }

    public function incV1()
    {
        $this->cnt_v++;
    }

    public function incV2()
    {
        $this->cnt_v_after_extra++;
    }

    public function incV3()
    {
        $this->cnt_v_after_penalty++;
    }

    public function incT1()
    {
        $this->cnt_t++;
    }

    public function incT2()
    {
        $this->cnt_t_after_extra++;
    }

    public function incT3()
    {
        $this->cnt_t_after_penalty++;
    }

    public function incD1()
    {
        $this->cnt_d++;
    }

    public function incD2()
    {
        $this->cnt_d_after_extra++;
    }

    public function incD3()
    {
        $this->cnt_d_after_penalty++;
    }

    public function addScore1($score1)
    {
        $this->score1 = $this->score1 + $score1;
    }

    public function addScore2($score2)
    {
        $this->score2 = $this->score2 + $score2;
    }

    public function addPoints($points)
    {
        $this->points = $this->points + $points;
    }

    public function addPoints2($points2)
    {
        $this->points2 = $this->points2 + $points2;
    }

    public function getV1()
    {
        return $this->cnt_v;
    }

    public function getV2()
    {
        return $this->cnt_v_after_extra;
    }

    public function getV3()
    {
        return $this->cnt_v_after_penalty;
    }

    public function getT1()
    {
        return $this->cnt_t;
    }

    public function getT2()
    {
        return $this->cnt_d_after_extra;
    }

    public function getT3()
    {
        return $this->cnt_d_after_penalty;
    }

    public function getD1()
    {
        return $this->cnt_d;
    }

    public function getD2()
    {
        return $this->cnt_d_after_extra;
    }

    public function getD3()
    {
        return $this->cnt_d_after_penalty;
    }

    public function getMatches()
    {
        return $this->cnt_matches;
    }

    public function getScore1()
    {
        return $this->score1;
    }

    public function getScore2()
    {
        return $this->score2;
    }

    public function getPoints()
    {
        return $this->points;
    }

    public function getPoints2()
    {
        return $this->points2;
    }

    public function getDiff()
    {
        return $this->score1 - $this->score2;
    }

    public function getScores()
    {
        return sprintf("%s:%s", $this->getScore1(), $this->getScore2());
    }

    public function getPoints2Points()
    {
        return sprintf("%s:%s", $this->getPoints(), $this->getPoints2());
    }

}